package com.aa.service.impl;

import com.aa.dao.AdminuserMapper;
import com.aa.entity.Adminuser;
import com.aa.service.AdminuserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminuserServiceImpl  implements AdminuserService {
    @Resource
    AdminuserMapper adminuserMapper;

    @Override
    public Adminuser geAdminUser(Adminuser adminuser) {
        return adminuserMapper.geAdminUser(adminuser);
    }

    @Override
    public PageInfo<Adminuser> queryAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize );
        List<Adminuser> list=adminuserMapper.queryAll();
        PageInfo<Adminuser> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public int deleteByID(Integer aduid) {
        return adminuserMapper.deleteByID(aduid);
    }

    @Override
    public Adminuser findById(Integer aduID) {
        return adminuserMapper.findById(aduID);
    }

    @Override
    public int update(Adminuser adminuser) {
        return adminuserMapper.update(adminuser);
    }

    @Override
    public int insert(Adminuser adminuser) {
        return adminuserMapper.insert(adminuser);
    }
}
